home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 10 / AACD 10.iso / AACD / Games / MAME / src / drivers / tagteam.c < prev    next >
C/C++ Source or Header  |  2000-04-04  |  12KB  |  359 lines

  1. /***************************************************************************
  2.  
  3. Tag Team Wrestling hardware description:
  4.  
  5. This hardware is very similar to the BurgerTime/Lock N Chase family of games
  6. but there are just enough differences to make it a pain to share the
  7. codebase. It looks like this hardware is a bridge between the BurgerTime
  8. family and the later Technos games, like Mat Mania and Mysterious Stones.
  9.  
  10. The video hardware supports 3 sprite banks instead of 1
  11. The sound hardware appears nearly identical to Mat Mania
  12.  
  13. TODO:
  14.         * fix hi-score (reset) bug
  15.  
  16. ***************************************************************************/
  17.  
  18. #include "driver.h"
  19. #include "vidhrdw/generic.h"
  20. #include "cpu/m6502/m6502.h"
  21.  
  22. void tagteam_vh_convert_color_prom(unsigned char *palette, unsigned short *colortable,const unsigned char *color_prom);
  23.  
  24. READ_HANDLER( tagteam_mirrorvideoram_r );
  25. WRITE_HANDLER( tagteam_mirrorvideoram_w );
  26. READ_HANDLER( tagteam_mirrorcolorram_r );
  27. WRITE_HANDLER( tagteam_mirrorcolorram_w );
  28. WRITE_HANDLER( tagteam_video_control_w );
  29. WRITE_HANDLER( tagteam_control_w );
  30.  
  31. int  tagteam_vh_start (void);
  32. void tagteam_vh_stop (void);
  33. void tagteam_vh_screenrefresh (struct osd_bitmap *bitmap, int full_refresh);
  34.  
  35. static WRITE_HANDLER( sound_command_w )
  36. {
  37.     soundlatch_w(offset,data);
  38.     cpu_cause_interrupt(1,M6502_INT_IRQ);
  39. }
  40.  
  41.  
  42. static struct MemoryReadAddress readmem[] =
  43. {
  44.     { 0x0000, 0x07ff, MRA_RAM },
  45.     { 0x2000, 0x2000, input_port_1_r },     /* IN1 */
  46.     { 0x2001, 0x2001, input_port_0_r },     /* IN0 */
  47.     { 0x2002, 0x2002, input_port_2_r },     /* DSW2 */
  48.     { 0x2003, 0x2003, input_port_3_r },     /* DSW1 */
  49.     { 0x4000, 0x43ff, tagteam_mirrorvideoram_r },
  50.     { 0x4400, 0x47ff, tagteam_mirrorcolorram_r },
  51.     { 0x4800, 0x4fff, MRA_RAM },
  52.     { 0x8000, 0xffff, MRA_ROM },
  53.     { -1 }  /* end of table */
  54. };
  55.  
  56. static struct MemoryWriteAddress writemem[] =
  57. {
  58.     { 0x0000, 0x07ff, MWA_RAM },
  59. //    { 0x2000, 0x2000, tagteam_unk_w },
  60.     { 0x2001, 0x2001, tagteam_control_w },
  61.     { 0x2002, 0x2002, sound_command_w },
  62. //    { 0x2003, 0x2003, MWA_NOP }, /* Appears to increment when you're out of the ring */
  63.     { 0x4000, 0x43ff, tagteam_mirrorvideoram_w },
  64.     { 0x4400, 0x47ff, tagteam_mirrorcolorram_w },
  65.     { 0x4800, 0x4bff, videoram_w, &videoram, &videoram_size },
  66.     { 0x4c00, 0x4fff, colorram_w, &colorram },
  67.     { 0x8000, 0xffff, MWA_ROM },
  68.     { -1 }  /* end of table */
  69. };
  70.  
  71.  
  72. static struct MemoryReadAddress sound_readmem[] =
  73. {
  74.     { 0x0000, 0x03ff, MRA_RAM },
  75.     { 0x2007, 0x2007, soundlatch_r },
  76.     { 0x4000, 0xffff, MRA_ROM },
  77.     { -1 }  /* end of table */
  78. };
  79.  
  80. static struct MemoryWriteAddress sound_writemem[] =
  81. {
  82.     { 0x0000, 0x03ff, MWA_RAM },
  83.     { 0x2000, 0x2000, AY8910_write_port_0_w },
  84.     { 0x2001, 0x2001, AY8910_control_port_0_w },
  85.     { 0x2002, 0x2002, AY8910_write_port_1_w },
  86.     { 0x2003, 0x2003, AY8910_control_port_1_w },
  87.     { 0x2004, 0x2004, DAC_0_data_w },
  88.     { 0x2005, 0x2005, interrupt_enable_w },
  89.     { -1 }  /* end of table */
  90. };
  91.  
  92.  
  93.  
  94. static int tagteam_interrupt(void)
  95. {
  96.     static int coin;
  97.     int port;
  98.  
  99.     port = readinputport(0) & 0xc0;
  100.  
  101.     if (port != 0xc0)    /* Coin */
  102.     {
  103.         if (coin == 0)
  104.         {
  105.             coin = 1;
  106.             return nmi_interrupt();
  107.         }
  108.     }
  109.     else coin = 0;
  110.  
  111.         return ignore_interrupt();
  112. }
  113.  
  114. INPUT_PORTS_START( tagteam )
  115.     PORT_START      /* IN0 */
  116.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_8WAY )
  117.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT  | IPF_8WAY )
  118.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_UP    | IPF_8WAY )
  119.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN  | IPF_8WAY )
  120.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 )
  121.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 )
  122.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN1 )
  123.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN2 )
  124.  
  125.     PORT_START      /* IN1 */
  126.     PORT_BIT( 0x01, IP_ACTIVE_LOW,  IPT_UNKNOWN )
  127.     PORT_BIT( 0x02, IP_ACTIVE_LOW,  IPT_UNKNOWN )
  128.     PORT_BIT( 0x04, IP_ACTIVE_LOW,  IPT_TILT )
  129.     PORT_BIT( 0x08, IP_ACTIVE_LOW,  IPT_UNKNOWN )
  130.     PORT_BIT( 0x10, IP_ACTIVE_LOW,  IPT_UNUSED )
  131.     PORT_BIT( 0x20, IP_ACTIVE_LOW,  IPT_UNUSED )
  132.     PORT_BIT( 0x40, IP_ACTIVE_LOW,  IPT_START1 )
  133.     PORT_BIT( 0x80, IP_ACTIVE_LOW,  IPT_START2 )
  134.  
  135.     PORT_START      /* DSW1 - 7 not used?, 8 = VBLANK! */
  136.     PORT_DIPNAME( 0x0f, 0x0f, DEF_STR( Coinage ) )
  137.     PORT_DIPSETTING(    0x00, DEF_STR( 2C_1C ) )
  138.     PORT_DIPSETTING(    0x0c, "A 2C/1C B 1C/1C" )
  139.     PORT_DIPSETTING(    0x08, "A 2C/1C B 1C/2C" )
  140.     PORT_DIPSETTING(    0x04, "A 2C/1C B 1C/3C" )
  141.     PORT_DIPSETTING(    0x03, "A 1C/1C B 2C/1C" )
  142.     PORT_DIPSETTING(    0x0f, DEF_STR( 1C_1C ) )
  143.     PORT_DIPSETTING(    0x0b, "A 1C/1C B 1C/2C" )
  144.     PORT_DIPSETTING(    0x07, "A 1C/1C B 1C/3C" )
  145.     PORT_DIPSETTING(    0x02, "A 1C/2C B 2C/1C" )
  146.     PORT_DIPSETTING(    0x0a, DEF_STR( 1C_2C ) )
  147.     PORT_DIPSETTING(    0x0e, "A 1C/2C B 1C/1C" )
  148.     PORT_DIPSETTING(    0x06, "A 1C/2C B 1C/3C" )
  149.     PORT_DIPSETTING(    0x01, "A 1C/3C B 2C/1C" )
  150.     PORT_DIPSETTING(    0x0d, "A 1C/3C B 1C/1C" )
  151.     PORT_DIPSETTING(    0x09, "A 1C/3C B 1C/2C" )
  152.     PORT_DIPSETTING(    0x05, DEF_STR( 1C_3C ) )
  153.     PORT_DIPNAME( 0x10, 0x00, DEF_STR( Cabinet ) )
  154.     PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
  155.     PORT_DIPSETTING(    0x10, DEF_STR( Cocktail ) )
  156.     PORT_DIPNAME( 0x20, 0x00, "Control Panel" )
  157.     PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
  158.     PORT_DIPSETTING(    0x20, DEF_STR( Cocktail ) )
  159.     PORT_DIPNAME( 0x40, 0x00, DEF_STR( Unknown ) )
  160.     PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
  161.     PORT_DIPSETTING(    0x40, DEF_STR( On ) )
  162.     PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_VBLANK  )
  163.  
  164.     PORT_START      /* DSW2 - 3,4,5,6,7,8 = not used? */
  165.     PORT_DIPNAME( 0x01, 0x01, DEF_STR( Difficulty ) )
  166.     PORT_DIPSETTING(    0x01, "Normal" )
  167.     PORT_DIPSETTING(    0x00, "Hard" )
  168.     PORT_DIPNAME( 0x02, 0x00, DEF_STR( Demo_Sounds ) )
  169.     PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
  170.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  171.     PORT_DIPNAME( 0x04, 0x00, DEF_STR( Unknown ) )
  172.     PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
  173.     PORT_DIPSETTING(    0x04, DEF_STR( On ) )
  174.     PORT_DIPNAME( 0x08, 0x00, DEF_STR( Unknown ) )
  175.     PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
  176.     PORT_DIPSETTING(    0x08, DEF_STR( On ) )
  177.     PORT_DIPNAME( 0x10, 0x00, DEF_STR( Unknown ) )
  178.     PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
  179.     PORT_DIPSETTING(    0x10, DEF_STR( On ) )
  180.     PORT_DIPNAME( 0x20, 0x00, DEF_STR( Unknown ) )
  181.     PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
  182.     PORT_DIPSETTING(    0x20, DEF_STR( On ) )
  183.     PORT_DIPNAME( 0x40, 0x00, DEF_STR( Unknown ) )
  184.     PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
  185.     PORT_DIPSETTING(    0x40, DEF_STR( On ) )
  186.     PORT_DIPNAME( 0x80, 0x00, DEF_STR( Unknown ) )
  187.     PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
  188.     PORT_DIPSETTING(    0x80, DEF_STR( On ) )
  189. INPUT_PORTS_END
  190.  
  191.  
  192.  
  193. static struct GfxLayout charlayout =
  194. {
  195.     8,8,    /* 8*8 characters */
  196.     3072,   /* 3072 characters */
  197.     3,      /* 3 bits per pixel */
  198.     { 2*3072*8*8, 3072*8*8, 0 },    /* the bitplanes are separated */
  199.     { 0, 1, 2, 3, 4, 5, 6, 7 },
  200.     { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8 },
  201.     8*8     /* every char takes 8 consecutive bytes */
  202. };
  203.  
  204.  
  205. static struct GfxLayout spritelayout =
  206. {
  207.     16,16,  /* 16*16 sprites */
  208.     768,    /* 768 sprites */
  209.     3,      /* 3 bits per pixel */
  210.     { 2*768*16*16, 768*16*16, 0 },  /* the bitplanes are separated */
  211.     { 16*8+0, 16*8+1, 16*8+2, 16*8+3, 16*8+4, 16*8+5, 16*8+6, 16*8+7,
  212.             0, 1, 2, 3, 4, 5, 6, 7 },
  213.     { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8,
  214.             8*8, 9*8, 10*8, 11*8, 12*8, 13*8, 14*8, 15*8 },
  215.     32*8    /* every sprite takes 32 consecutive bytes */
  216. };
  217.  
  218. static struct GfxDecodeInfo tagteam_gfxdecodeinfo[] =
  219. {
  220.     { REGION_GFX1, 0, &charlayout,   0, 4 }, /* chars */
  221.     { REGION_GFX1, 0, &spritelayout, 0, 4 }, /* sprites */
  222.     { -1 } /* end of array */
  223. };
  224.  
  225.  
  226.  
  227. static struct AY8910interface ay8910_interface =
  228. {
  229.     2,      /* 2 chips */
  230.     1500000,        /* 1.5 MHz ?? */
  231.     { 25, 25 },
  232.     { 0 },
  233.     { 0 },
  234.     { 0 },
  235.     { 0 }
  236. };
  237.  
  238. static struct DACinterface dac_interface =
  239. {
  240.     1,
  241.     { 255 }
  242. };
  243.  
  244. static struct MachineDriver machine_driver_tagteam =
  245. {
  246.     /* basic machine hardware */
  247.     {
  248.         {
  249.             CPU_M6502,
  250.             1500000,    /* 1.5 Mhz ?? */
  251.             readmem,writemem,0,0,
  252.             tagteam_interrupt,1
  253.         },
  254.         {
  255.             CPU_M6502 | CPU_AUDIO_CPU,
  256.             975000,  /* 975 kHz ?? */
  257.             sound_readmem,sound_writemem,0,0,
  258.             nmi_interrupt,16   /* IRQs are triggered by the main CPU */
  259.         }
  260.     },
  261.     57, 3072,    /* frames per second, vblank duration */
  262.     1,    /* 1 CPU slice per frame - interleaving is forced when a sound command is written */
  263.     0,
  264.  
  265.     /* video hardware */
  266.     32*8, 32*8, { 0*8, 32*8-1, 1*8, 31*8-1 },
  267.     tagteam_gfxdecodeinfo,
  268.     32, 32,
  269.     tagteam_vh_convert_color_prom,
  270.  
  271.     VIDEO_TYPE_RASTER|VIDEO_SUPPORTS_DIRTY,
  272.     0,
  273.     generic_vh_start,
  274.     generic_vh_stop,
  275.     tagteam_vh_screenrefresh,
  276.  
  277.     /* sound hardware */
  278.     0,0,0,0,
  279.     {
  280.         {
  281.             SOUND_AY8910,
  282.             &ay8910_interface
  283.         },
  284.         {
  285.             SOUND_DAC,
  286.             &dac_interface
  287.         }
  288.     }
  289. };
  290.  
  291.  
  292.  
  293. ROM_START( bigprowr )
  294.     ROM_REGION( 0x10000, REGION_CPU1 )    /* 64k for code */
  295.     ROM_LOAD( "bf00-1.20",    0x08000, 0x2000, 0x8aba32c9 )
  296.     ROM_LOAD( "bf01.33",      0x0a000, 0x2000, 0x0a41f3ae )
  297.     ROM_LOAD( "bf02.34",      0x0c000, 0x2000, 0xa28b0a0e )
  298.     ROM_LOAD( "bf03.46",      0x0e000, 0x2000, 0xd4cf7ec7 )
  299.  
  300.     ROM_REGION( 0x10000, REGION_CPU2 )    /* 64k for audio code */
  301.     ROM_LOAD( "bf4.8",        0x04000, 0x2000, 0x0558e1d8 )
  302.     ROM_LOAD( "bf5.7",        0x06000, 0x2000, 0xc1073f24 )
  303.     ROM_LOAD( "bf6.6",        0x08000, 0x2000, 0x208cd081 )
  304.     ROM_LOAD( "bf7.3",        0x0a000, 0x2000, 0x34a033dc )
  305.     ROM_LOAD( "bf8.2",        0x0c000, 0x2000, 0xeafe8056 )
  306.     ROM_LOAD( "bf9.1",        0x0e000, 0x2000, 0xd589ce1b )
  307.  
  308.     ROM_REGION( 0x12000, REGION_GFX1 | REGIONFLAG_DISPOSE )
  309.     ROM_LOAD( "bf10.89",      0x00000, 0x2000, 0xb1868746 )
  310.     ROM_LOAD( "bf11.94",      0x02000, 0x2000, 0xc3fe99c1 )
  311.     ROM_LOAD( "bf12.103",     0x04000, 0x2000, 0xc8717a46 )
  312.     ROM_LOAD( "bf13.91",      0x06000, 0x2000, 0x23ee34d3 )
  313.     ROM_LOAD( "bf14.95",      0x08000, 0x2000, 0xa6721142 )
  314.     ROM_LOAD( "bf15.105",     0x0a000, 0x2000, 0x60ae1078 )
  315.     ROM_LOAD( "bf16.93",      0x0c000, 0x2000, 0xd33dc245 )
  316.     ROM_LOAD( "bf17.96",      0x0e000, 0x2000, 0xccf42380 )
  317.     ROM_LOAD( "bf18.107",     0x10000, 0x2000, 0xfd6f006d )
  318.  
  319.     ROM_REGION( 0x0040, REGION_PROMS )
  320.     ROM_LOAD( "fko.8",        0x0000, 0x0020, 0xb6ee1483 )
  321.     ROM_LOAD( "fjo.25",       0x0020, 0x0020, 0x24da2b63 ) /* What is this prom for? */
  322. ROM_END
  323.  
  324. ROM_START( tagteam )
  325.     ROM_REGION( 0x10000, REGION_CPU1 )    /* 64k for code */
  326.     ROM_LOAD( "prowbf0.bin",  0x08000, 0x2000, 0x6ec3afae )
  327.     ROM_LOAD( "prowbf1.bin",  0x0a000, 0x2000, 0xb8fdd176 )
  328.     ROM_LOAD( "prowbf2.bin",  0x0c000, 0x2000, 0x3d33a923 )
  329.     ROM_LOAD( "prowbf3.bin",  0x0e000, 0x2000, 0x518475d2 )
  330.  
  331.     ROM_REGION( 0x10000, REGION_CPU2 )    /* 64k for audio code */
  332.     ROM_LOAD( "bf4.8",        0x04000, 0x2000, 0x0558e1d8 )
  333.     ROM_LOAD( "bf5.7",        0x06000, 0x2000, 0xc1073f24 )
  334.     ROM_LOAD( "bf6.6",        0x08000, 0x2000, 0x208cd081 )
  335.     ROM_LOAD( "bf7.3",        0x0a000, 0x2000, 0x34a033dc )
  336.     ROM_LOAD( "bf8.2",        0x0c000, 0x2000, 0xeafe8056 )
  337.     ROM_LOAD( "bf9.1",        0x0e000, 0x2000, 0xd589ce1b )
  338.  
  339.     ROM_REGION( 0x12000, REGION_GFX1 | REGIONFLAG_DISPOSE )
  340.     ROM_LOAD( "prowbf10.bin", 0x00000, 0x2000, 0x48165902 )
  341.     ROM_LOAD( "bf11.94",      0x02000, 0x2000, 0xc3fe99c1 )
  342.     ROM_LOAD( "prowbf12.bin", 0x04000, 0x2000, 0x69de1ea2 )
  343.     ROM_LOAD( "prowbf13.bin", 0x06000, 0x2000, 0xecfa581d )
  344.     ROM_LOAD( "bf14.95",      0x08000, 0x2000, 0xa6721142 )
  345.     ROM_LOAD( "prowbf15.bin", 0x0a000, 0x2000, 0xd0de7e03 )
  346.     ROM_LOAD( "prowbf16.bin", 0x0c000, 0x2000, 0x75ee5705 )
  347.     ROM_LOAD( "bf17.96",      0x0e000, 0x2000, 0xccf42380 )
  348.     ROM_LOAD( "prowbf18.bin", 0x10000, 0x2000, 0xe73a4bba )
  349.  
  350.     ROM_REGION( 0x0040, REGION_PROMS )
  351.     ROM_LOAD( "fko.8",        0x0000, 0x0020, 0xb6ee1483 )
  352.     ROM_LOAD( "fjo.25",       0x0020, 0x0020, 0x24da2b63 ) /* What is this prom for? */
  353. ROM_END
  354.  
  355.  
  356.  
  357. GAME( 1983, bigprowr, 0,        tagteam, tagteam, 0, ROT270, "Technos", "The Big Pro Wrestling!" )
  358. GAME( 1983, tagteam,  bigprowr, tagteam, tagteam, 0, ROT270, "Technos (Data East license)", "Tag Team Wrestling" )
  359.